/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package ormsamples;

import org.orm.*;
public class DeleteSalaData {
	public void deleteTestData() throws PersistentException {
		PersistentTransaction t = orm.SalaPersistentManager.instance().getSession().beginTransaction();
		try {
			orm.DAOFactory lDAOFactory = orm.DAOFactory.getDAOFactory();
			orm.dao.SalaDAO lormSalaDAO = lDAOFactory.getSalaDAO();
			orm.Sala lormSala = lormSalaDAO.loadSalaByQuery(null, null);
			// Delete the persistent object
			lormSalaDAO.delete(lormSala);
			t.commit();
		}
		catch (Exception e) {
			t.rollback();
		}
		
	}
	
	public static void main(String[] args) {
		try {
			DeleteSalaData deleteSalaData = new DeleteSalaData();
			try {
				deleteSalaData.deleteTestData();
			}
			finally {
				orm.SalaPersistentManager.instance().disposePersistentManager();
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
